#!/bin/sh

MAINCLASS="@MAIN-CLASS@"

APP_HOME=			# Application home
BIN_PATH=			# Binary path $APP_HOME/bin
LIB_PATH=			# Library path $APP_HOME/lib
ETC_PATH=			# Configuration path
DOC_PATH=			# Documentation path $APP_HOME/docs

BIN_FILE=$0
if [ -L $BIN_FILE ]; then
    BIN_FILE=`readlink -n $BIN_FILE`
fi

BIN_NAME=`basename $BIN_FILE`

BIN_PATH=`dirname $BIN_FILE`
if [ $BIN_PATH = "." ]; then
    BIN_PATH=`pwd`
fi

APP_HOME=`dirname $BIN_PATH`
LIB_PATH="$APP_HOME/lib"
DOC_PATH="$APP_HOME/docs"

APP_JARS="$LIB_PATH/*.jar"
for jar in $APP_JARS
do
    if [ -z $CLASSPATH ]; then
	CLASSPATH="$jar"
    else
	CLASSPATH="$CLASSPATH:$jar"
    fi
done
CLASSPATH="$CLASSPATH:."

JAR_FILE="$LIB_PATH/$BIN_NAME.jar"

java -classpath $CLASSPATH $MAINCLASS $*
